import { AsyncStorage, } from 'react-native';

const TOKEN = 'PAY_SEED_TOKEN';
const USER_ID = 'PAY_SEED_USER_ID';
const PHONE = 'PAY_SEED_PHONE';
const saveToken = (token) => {
  AsyncStorage.setItem(TOKEN, token);
};

const getToken = () => {
  return AsyncStorage.getItem(TOKEN);
};

const savePhone = (phone) => {
  AsyncStorage.setItem(PHONE, phone);
};

const getPhone = () => {
  return AsyncStorage.getItem(PHONE);
};

const saveUserId = (userId) => {
  AsyncStorage.setItem(USER_ID, userId);
};

const getUserId = () => {
  return AsyncStorage.getItem(USER_ID);
};

module.exports = {
  saveToken,
  getToken,
  saveUserId,
  getUserId,
  savePhone,
  getPhone
};
